You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. Reuse _CohereCompatibleRerankClient instead of re-implementing it
The DashScope compatible endpoint speaks the same wire format as the existing helper at hindsight_api/engine/cross_encoder.py:530 ({model, query, documents, top_n} → {results: [{index, relevance_score}]}). _rerank_compatible duplicates that logic. Compose the helper the way SiliconFlowCrossEncoder (line 768) and ZeroEntropyCrossEncoder (line 726) do — you get the query-grouping and request shape for free.
2. Drop _COMPATIBLE_MODELS
Hardcoding frozenset({"qwen3-rerank"}) means any new variant (qwen3-rerank-plus, future qwen3-reranker-*, etc.) silently routes to the native endpoint and fails with a shape mismatch. Pick one:
Only support the compatible endpoint and remove the native path entirely (simplest — qwen3-rerank is the headline model here).
Or expose endpoint selection as an explicit config flag rather than inferring it from the model name.
3. Documentation is missing
hindsight-docs/docs/developer/configuration.md:556 — add alibaba to the HINDSIGHT_API_RERANKER_PROVIDER value list, plus rows for HINDSIGHT_API_RERANKER_ALIBABA_API_KEY / _MODEL next to the SiliconFlow block (~line 583).
hindsight-docs/docs/developer/models.mdx:475 — provider table entry and an example env-var block (mirror the SiliconFlow one at line 553).
Also: the class docstring says auth comes from DASHSCOPE_API_KEY or HINDSIGHT_API_RERANKER_ALIBABA_API_KEY, but from_env only reads the latter — either drop the claim or add the fallback (Cohere does it at config.py:1581).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
support alibaba qwen3-rerank